package com.android.launcher3.manager;

import android.support.annotation.Nullable;

import com.android.launcher3.annotation.ToDoByDeson;

import java.util.ArrayList;
import java.util.List;

@ToDoByDeson
public enum WifiManager {
    INSTANCE;

    private final List<WifiListener> listeners = new ArrayList<>();

    ///打开Wifi开关
    void enable() {

    }

    ///关闭Wifi开关
    void disable() {

    }

    void startScan(ScanListener scanListener) {

    }

    ///关闭扫描时，或者链接蓝牙后，清除全部监听
    void stopScan() {

    }

    void connect(WifiInfo wifiInfo) {

    }

    void disConnect(@Nullable WifiInfo wifiInfo) {

    }


    void addListener(WifiListener wifiListener) {
        listeners.add(wifiListener);
    }

    void cancelListener(WifiListener wifiListener) {
        listeners.remove(wifiListener);
    }

    ///当前没有链接return null
    @Nullable
    WifiInfo getConnectedInfo() {
        return null;
    }


    public static class WifiInfo {
        String name;
        String getAddress;
        int getType;
        int signalStrength;
    }


    public interface WifiListener {

        void onConnected(WifiInfo bluetoothInfo);

        void onDisConnected(@Nullable WifiInfo bluetoothInfo);

        ///信号强度变化
        void signalStrengthChanges(int signalStrength);

    }

    public interface ScanListener {

        ///扫描有结果变化不断返回
        void onScan(List<WifiInfo> wifiInfos);

    }

}
